from keras.metrics import top_k_categorical_accuracy

def acc_top3(y_true, y_pred):
    """返回top3准确率"""
    return top_k_categorical_accuracy(y_true, y_pred, k=3)

def acc_top5(y_true, y_pred):
    """返回top5准确率"""
    return top_k_categorical_accuracy(y_true, y_pred, k=5)